<%--                                                                       --%>
<%-- Copyright (c) 2001-2004 BroadVision, Inc.  All rights reserved.       --%>
<%--                                                                       --%>
<%-- This software is copyrighted. Under the copyright laws, this software --%>
<%-- may not be copied, in whole or in part, without prior written consent --%>
<%-- of BroadVision, Inc. or its assignees. This software is provided      --%>
<%-- under the terms of a license between BroadVision and the recipient,   --%>
<%-- and its use is subject to the terms of that license.                  --%>
<%--                                                                       --%>
<%-- This software may be protected by one or more U.S. and International  --%>
<%-- patents.  Certain applications of BroadVision One-To-One software are --%>
<%-- covered by U.S. patent 5,710,887.                                     --%>
<%--                                                                       --%>
<%-- TRADEMARKS: BroadVision and BroadVision One-To-One are registered     --%>
<%-- trademarks of BroadVision, Inc., in the United States and the         --%>
<%-- European Community, and are trademarks of BroadVision, Inc., in other --%>
<%-- countries.  The BroadVision logo, is a trademark of BroadVision,      --%>
<%-- Inc., in the United States and other countries. Additionally, IONA    --%>
<%-- and Orbix are trademarks of IONA Technologies, Ltd.  RSA, MD5, and    --%>
<%-- RC2 are trademarks of RSA Data Security, Inc.                         --%>
<%--                                                                       --%>

<%@ page language="java" %>
<%@ page import = "java.util.*" %>

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>  
<%@ taglib uri="/WEB-INF/bv-html.tld" prefix="bvhtml" %>
             
<script language=JavaScript>
<!--

//
// Trims leading blanks.
//
function stringLeftTrim(s)
{
   return s.replace(/^ +/, "");
}

//
// Trims trailing blanks.
//
function stringRightTrim(s)
{
   return s.replace(/ +$/, "");
}

//
// Trims leading and trailing blanks.
//
function stringTrim(s)
{
   return stringRightTrim(stringLeftTrim(s));
}

//
// Validate the user's entries.
//
function validateForm()
{
   var len = document.csMeetingNotifyEditForm.selectedParticipants.length;
   var checkCount = 0;
  
   if (len >= 2) {
       for (var i=0; i<len; i++) {
           if (document.csMeetingNotifyEditForm.selectedParticipants[i].checked == true) 
            checkCount ++ ;
       }
   } else {
       if (document.csMeetingNotifyEditForm.selectedParticipants.checked == true) 
    checkCount ++;  
   }

   if (checkCount == 0) 
   {
      alert("<bean:message key="cs.error.meeting.notify.participant"/>");
      return false;
   }

   var msg = stringTrim(document.csMeetingNotifyEditForm.message.value);

   if (msg == "")
   {
      alert("<bean:message key="cs.error.meeting.notify.message"/>");
      return false;
   }

   return true;
}

function onClickReset() {
  document.csMeetingNotifyEditForm.reset();
}

function onClickCancel(theForm, actionUrl) {
  theForm.action = actionUrl;
  theForm.submit();
}

function onClickSend() {
  if (validateForm()) {
    document.csMeetingNotifyEditForm.submit();
  }
}

<%@ include file="/cs/microsite/jsutils.jsp" %>

// -->
</script>

<!-- Zone 5 starts here.  -->
      
<table class="zoneFive" width="100%" border="0" cellspacing="0" cellpadding="0" 
       summary="content area">
  <tr>
    <td valign="top">
    
    <!--start microsite logo and name here-->
      <div class="pageTitle">
        <%@ include file="/cs/microsite/micrositeNaviInfo.jsp" %>
      </div> 
    <!--end microsite logo and name here-->
    
    <!--start title bar here-->
    <div class="pageSubtitle">
      <span class="left">
        <bean:write name="meetingNotifyEditView" property="meetingName"/>&nbsp;<bean:message key="cs.meeting.notification"/>
      </span>
    </div> 
    <!--end title bar here--> 
    
    <div class="blockWrap">
    
    <!-- start Page Instructions -->
    <div class="pageInstructions">
      <bean:message key="cs.meeting.notify.note"/>
    </div>
    <!-- End Page Instructions -->
    
    
    <html:form action="/cs/meetingNotifySend.do" method="post" >
    
    <bvhtml:hiddenList name="micrositeNaviInfoView" property="urlParams" scope="request"/>   

    <%-- Set selected groupIds as hidden field, so when submitted data fail 
      in server side validation, we can still easily set view bean information
      and go back to this page.
    --%>
    
    <logic:iterate id="oneGroupId" name="csMeetingNotifyEditForm" property="groupIds" indexId="index">
      <input type="hidden" name="groupIds" value='<bean:write name="oneGroupId"/>'>
    </logic:iterate>

    <!--start main content area here-->
    <table class="labelForm" width="100%" border="0" cellspacing="0" 
           cellpadding="0" summary="meeting Notification">
      <tr> 
        <td nowrap width="13%" class="label" valign="top">
          <bean:message key="cs.message"/>*: 
        </td>
        <td nowrap width="87%" class="labelField">
          <html:textarea property="message" cols="45" rows="5"/>
        </td>
    </table>
    
    <div class="pageSubsubtitle">
      <span class="left">
        <bean:message key="cs.meeting.notify.select.participants"/>
      </span>
    </div>    

    <!--end page title area here-->
    <div class="globalButtonWrap">
      <input type="button" name="selectAll" class="globalButton"
             onclick="check(this.form.selectedParticipants,this);" 
             value="<bean:message key='button.selectAll'/>"> 
    </div>
            
    <%-- participant list --%>
    <table class="dataTable" border="0" cellspacing="1" cellpadding="2" 
           summary="participant list table" width="100%">
      <tr class="listHeader"> 
        <th id="Checkboxs" align="center"><bean:message key="cs.select"/></th>
        <th id="Name" align="left"><bean:message key="cs.name"/></th>
      </tr>
    
      <logic:iterate id="oneParticipant" name="meetingNotifyEditView" property="participants" 
                     indexId="index">
        <tr class='<%=index.intValue() %2 == 0 ? "listEven" : "listOdd"%>'> 
          <td headers="Checkboxs" nowrap width="10%" align="center"> 
           <html:multibox property="selectedParticipants">
             <bean:write name="oneParticipant" property="value"/>
           </html:multibox>
          </td>
          <td headers="Name" width="90%">
            <bean:write name="oneParticipant" property="label" />
          </td>
        </tr>
      </logic:iterate>
    </table>
  
    <!--start cancel, reset, save bar area here-->
  
    <div class="pageButtonWrap" align="right">
      <input type="button" class="pageButton" name="resetBtn" 
                   titleKey="button.reset" onclick="onClickReset()"
                   value='<bean:message key="button.reset"/>'>
                   
      <input type="button" class="pageButton" name="cancelBtn"
             titleKey="button.cancel" 
             value='<bean:message key="button.cancel"/>'
             onclick="onClickCancel(this.form, '<html:rewrite page="/cs/meetingView.do" />')">

      <input type="button" class="pageButton" name="sendBtn" 
             titleKey="button.send" onclick="onClickSend()"
             value='<bean:message key="button.send"/>'>
    </div>
   
    <!--end cancel, reset, save bar area here-->
  
    </html:form>
    </div>
    
    </td>
  </tr>
</table>


